/**
 * 
 */
package com.mvc.service.vo.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.alibaba.fastjson.JSON;
import com.mvc.dao.mapper.vo.*;
import com.mvc.framework.constant.GlobalConstant;
import com.mvc.model.vo.*;
import com.mvc.service.vo.*;
import com.mvc.utils.PublicSecret;

/**
 * 双向转诊病人信息实现类
 * @author qingjie
 * @see com.service.ParientInfoService#getParientInfo(java.lang.String)
 * Date:2015-09-19 15:25
 */
@Service
public class ParientInfoServiceImpl implements ParientInfoService {
	
	@Autowired
	private ParientInfoDao pInfoDao;

	@Override
	public String getParientInfo(String json,String key) {
		PublicSecret crypt = PublicSecret.getInstance();
		ParientInfoBean pBean = JSON.parseObject(json, ParientInfoBean.class);
		if(pBean==null){
			pBean = new ParientInfoBean();
		}
		List<ParientInfoBean> list = pInfoDao.getParientInfoList(pBean);
		return crypt.encryptAES(JSON.toJSONString(list),key);
	}

}
